Skip to content

docs: fix misleading internal import path in Getting Started guide - #4

Open
ElizioMartins wants to merge 1 commit into
objectbox:mainfrom
ElizioMartins:fix/getting-started-import-path
Open

ElizioMartins wants to merge 1 commit into
objectbox:mainfrom
ElizioMartins:fix/getting-started-import-path

Conversation

@ElizioMartins

Copy link
Copy Markdown

Problem

The "Initializing ObjectBox" section of the Getting Started guide shows this import:

import (
    "github.com/objectbox/objectbox-go/objectbox"
    "github.com/objectbox/objectbox-go/examples/tasks/internal/model" // ❌ wrong
)

This is the import path of the internal example package inside the ObjectBox repository itself. In Go, internal packages can only be imported by code within the same module — so any user who copies this snippet verbatim will immediately get a compile error:

use of internal package github.com/objectbox/objectbox-go/examples/tasks/internal/model not allowed

This issue has been open since November 2020 (objectbox/objectbox-go#28) and has caused confusion for multiple users.

Fix

Replaced the internal import with a generic placeholder (github.com/my-org/my-project/internal/model) and added a {% hint style="warning" %} block that makes it explicit users must substitute their own module name:

import (
    "github.com/objectbox/objectbox-go/objectbox"
    "github.com/my-org/my-project/internal/model" // ✅ user's own module
)

This matches what the ObjectBox maintainer already explained in the issue thread — users should initialize their own Go module and use their own import paths.

Fixes objectbox/objectbox-go#28


About the contributor: I'm a developer passionate about open source and always looking for opportunities to contribute and grow. If you're looking for collaborators or have open positions, feel free to reach out!

The "Initializing ObjectBox" section used the internal example package
path as an import in the code snippet:

  "github.com/objectbox/objectbox-go/examples/tasks/internal/model"

Go enforces that internal packages can only be imported by code within
the same module, so copying this snippet causes an immediate compile
error: "use of internal package ... not allowed".

Replace it with a generic placeholder that clearly shows users they
must substitute their own module name, and add a hint block to make
that requirement explicit.

Fixes objectbox/objectbox-go#28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Following GETTING STARTED guide does not work

1 participant